<template>
    <a-tabs defaultActiveKey="api" style="width:100%;" @change="tabChange">
        <a-tab-pane key="api" :tab="i18n('isTab.interface','接口')">
            <sys-interface-api-info ref="api" />
        </a-tab-pane>
        <a-tab-pane key="data" :tab="i18n('isTab.dataManagement','数据管理')" force-render>
            <sys-interface-data-manager ref="data" />
        </a-tab-pane>
        <a-tab-pane key="setting" :tab="i18n('isTab.set','设置')" force-render>
            <sys-interface-project-info :layerid="layerid" :destroy="destroy" ref="setting" :appId="curApp.appId" />
        </a-tab-pane>
    </a-tabs>
</template>
<script>
    import SysInterfaceProjectApi from '@/api/system/core/sysInterfaceProject'
    import SysInterfaceProjectInfo from "./SysInterfaceProjectInfo";
    import SysInterfaceApiInfo from "./SysInterfaceApiInfo";
    import SysInterfaceDataManager from "./SysInterfaceDataManager";
    import {BaseForm} from "@lowcode/jpaas-common-lib";
    export default {
        name: 'SysInterfaceProjectEdit',
        mixins:[BaseForm],
        components: {
            SysInterfaceProjectInfo,
            SysInterfaceApiInfo,
            SysInterfaceDataManager
        },
        methods: {
            i18n(name, text, key) {
                return this.$ti18(name, text, "sysInterfaceProject", key);
            },
            //fsad
            get(id) {
                return SysInterfaceProjectApi.get(id);
            },
            onload_(values) {
                this.$refs.api.setData(this.pkId);
            },
            tabChange(key){
                if(key=='api'){
                    this.$refs.api.setData(this.pkId);
                }else if(key=='data'){
                    this.$refs.data.setData(this.pkId);
                }else if(key=='setting'){
                    this.$refs.setting.setData(this.pkId);
                }
            }
        }
    }
</script>
